﻿using System.Threading;
using System.Threading.Tasks;
using wt.wine.Domain.Entities;
using wt.wine.Application.Common.Models;
using wt.wine.Application.ManageUserTable;
using System;

namespace wt.wine.Application.Common.Interfaces
{
    public interface IUsertableRepository
    {
        Task<usertable> Login(string account, string password, CancellationToken cancellationtoken);

        Task<usertable> GetUpdateUserTableById(int id, int userid, CancellationToken cancellationtoken);

        /// <summary>
        /// 判断当前账号是否存在
        /// </summary>
        /// <param name="account"></param>
        /// <param name="cancellationtoken"></param>
        /// <returns></returns>
        Task<int> GetAccountCount(int id, string account, CancellationToken cancellationtoken);

        /// <summary>
        /// 添加员工
        /// </summary>
        /// <param name="model"></param>
        /// <param name="cancellationtoken"></param>
        /// <returns></returns>
        Task AddUserTable(usertable model, CancellationToken cancellationtoken);

        Task<GetUserTableByIdDTO> GetUserTableById(int id, int userid, CancellationToken cancellationtoken);

        Task<PaginatedList<GetUserTableByIdDTO>> GetUserList(int userid, int pageIndex, int pageSize, CancellationToken cancellationtoken);

        Task<int> GetLevel(int userid, CancellationToken cancellationtoken);

        Task EditDeviceTableList(DateTime dt_now, CancellationToken cancellationtoken);

        Task<int> GetUserTableIdByAccount(int parentid, string account, CancellationToken cancellationtoken);

        Task EditDeviceTable(usertable model,bool isUodatePwd, CancellationToken cancellationtoken);
    }
}
